home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / akcl / akcl1615.lha / h / rios.h < prev    next >
C/C++ Source or Header  |  1992-04-11  |  5KB  |  216 lines

  1. #define ATT
  2. #define RIOS
  3. #define AIX
  4. #define AIX3  
  5. #include "att.h"
  6.  
  7.   
  8. #define ADDITIONAL_FEATURES \
  9.                ADD_FEATURE("AIX");\
  10.                ADD_FEATURE("AIX3");\
  11.                  ADD_FEATURE("RIOS");\
  12.                ADD_FEATURE("BUGGY-CC"); 
  13.  
  14. /*  These are supplied in rios_ics.s
  15. #define USE_C_EXTENDED_DIV
  16. #define USE_C_EXTENDED_MUL
  17. */
  18.  
  19. #define    IBMRT
  20. #define    IEEEFLOAT
  21.  
  22. #undef SET_REAL_MAXPAGE
  23. #define SET_REAL_MAXPAGE \
  24.     real_maxpage= ulimit(3)/PAGESIZE; \
  25.     if (real_maxpage > MAXPAGE) \
  26.         real_maxpage = MAXPAGE;
  27.  
  28. #define N_DATADDR(header) 
  29. #define DATA_BEGIN (char *)header.a_dbase
  30.  
  31. #define PAGEWIDTH 12
  32.   
  33. /* I don't know why all the bsd versions are subtracting this off
  34.    I thought the header.a_text was the actual size of the text
  35.    not including the header */
  36.  
  37. #define LD_COMMAND(command,main,start,input,ldarg,output) \
  38.   sprintf(command, "ld -d -x -A %s -T %x %s %s -o %s", \
  39.             main,start,input,ldarg,output)
  40. /* smallest address data can occur */
  41. #define DBEGIN  0x20000000
  42. #define FIX_ADDRESS(jj) \
  43.   do {int del = (int) data_load_addr - DBEGIN; \
  44.    if (del && (0x20000000 & jj)) jj += del; \
  45.    {unsigned short x ;  fread(&x,sizeof(short),1,symin); \
  46.       SYM_TC_OFF(c_table,i) = x;} \
  47.    } while(0)
  48.  
  49. /*
  50. #define SYM_EXTERNAL_P(sym) (((sym)->n_sclass & (~N_SECT)) == C_EXT)
  51. #define SYM_UNDEF_P(sym) (((sym)->n_sclass & N_SECT) ==  N_UNDF)
  52. */
  53.  
  54.  
  55. #define N_SECTION(sym) (((struct syment *)sym)->n_scnum)
  56.             
  57.  
  58. #define N_TYPE N_SECT  
  59.  
  60. /* the header is regared as part of the text */
  61.  
  62. #define N_RELOFF(header) A_TRELPOS(header)
  63. #define SYMNMLEN 8
  64.  
  65.   /* in aix we must use the pointer to the constant pool for the init_code,
  66.      not the actual pointer to the code.  */
  67.  
  68. #define CALL_INIT \
  69. { FUNC at=(FUNC)(init_address + memory->cfd.cfd_start ); \
  70.   if (at==0 || *(char **)at!= memory->cfd.cfd_start) \
  71.     FEerror("init code constant pool bad"); \
  72.   (*at)(memory->cfd.cfd_start, memory->cfd.cfd_size, data);} 
  73.  
  74.   /* find the first symbol in the data section:
  75.      It should begin with with "_init_" and correspond to the
  76.      beginning of the pcp pool for the init function..*/
  77. #define DATA_NSCN  4
  78.     /* the section number of the data section : text,pad,data,...*/
  79.  
  80. #define FIND_INIT \
  81.  { if (*ptr==0 && (N_SECTION(sym) == DATA_NSCN ) && \
  82.        ((sym)->n_sclass  == C_EXT) &&\
  83.        sym->n_value ) \
  84.   { char tem [9]; \
  85.     char *str=SYM_NAME(sym); \
  86.      dprintf(find init: %s ,str); \
  87.   if (str[0]=='i'    && str[1]=='n'  && str[2]=='i' && str[3]== 't' \
  88.       && str[4]=='_' &&  str[strlen(str)-1] !='X')  \
  89.     *ptr=  sym->n_value ; \
  90.    else {/* printf("The first data symbol was not the init"); */}    \
  91.  }} 
  92.  
  93.   
  94. #define RELOC_FILE "rel_rios.c"
  95.  
  96. #define GETCWD
  97.   /* the system defines a different getwd */
  98. #define getwd ourgetwd
  99.   
  100. /* these two symbols are too long for the rt pl8cc compiler */
  101.   
  102. #define check_type_or_pathname_string_symbol_stream  check_type_or_path_or_strm
  103. #define check_type_or_Pathname_string_symbol check_type_or_path_sym
  104. #define TSor_pathname_string_symbol_stream  TSor_path_string_sym_strm  
  105. #define check_type_or_symbol_string_package check_type_or_sym_str_pack  
  106.  
  107.  
  108. #ifdef IN_UNIXFSYS
  109. #define BSD
  110. #undef NEED_GETWD
  111. #undef ATT
  112. #endif
  113.  
  114. #define NOFREE_ERR
  115. #define UNIXSAVE "saveaix3.c"
  116.  
  117.  
  118. #define ISCOFF(x) (x==479)
  119. /* Should really use this */
  120. /*
  121. #define TEXT_NSCN (fileheader.f_opthdr > 28 ? header.o_sntext : 1)
  122. #define DATA_NSCN (fileheader.f_opthdr > 28 ? header.o_sndata : 2)
  123. #define BSS_NSCN (fileheader.f_opthdr > 28 ? header.o_snbss : 3)
  124. */
  125. #define TEXT_NSCN 2
  126. #define DATA_NSCN 4
  127. #define BSS_NSCN 5
  128.  
  129. #define SYM_EXTERNAL_P(sym) ((sym)->n_sclass  == C_EXT)
  130.  
  131. #define EXT_and_TEXT_BSS_DAT(p) \
  132.  ( SYM_EXTERNAL_P(p) && \
  133.   ((p)->n_scnum ==  TEXT_NSCN || (p)->n_scnum ==  BSS_NSCN  || \
  134.   (p)->n_scnum ==  DATA_NSCN ))
  135.  
  136. #define CLEAR_CACHE do{extern system(),myics(); myics();\
  137.              system("true"); \
  138.                if (*next_toc_addresses_to_relocate) \
  139.                  printf("did not relocate all toc addresses"); \
  140.              }while(0);
  141.  
  142.  
  143.  
  144. /* Begin for cmpinclude */
  145. /* yes we have alloca */
  146. /* #define HAVE_ALLOCA */
  147.  
  148. /* make signals stay installed, not lapse every time the
  149.    signal is sent */
  150. #define signal sigset
  151.  
  152.  
  153.  
  154. /* NOTE: If you don't have the system call mprotect DON'T
  155.    define this.
  156.    I have added it to my own kernel.
  157.    */
  158.  
  159.  
  160. /* If you define this you must make available mprotect system call
  161. for the kernel.   See aix3_mprotect directory.
  162. */
  163. /* #define SGC
  164. #define GET_FAULT_ADDR(x,y,c,d) getfault()
  165. */
  166.  
  167. #define QUICK_DIV(x,y,h,hi)\
  168.  if ((int)y > 0 && y > h << 1) \
  169.    {return divsl3(x,y,hi);}
  170.  
  171.  
  172. /* _setjmp and _longjmp exist on bsd and are more efficient
  173.    and handle the C stack which is all we need. [I think!]
  174.    
  175.  */
  176. /*
  177. #define setjmp _setjmp
  178. #define longjmp _longjmp
  179. */
  180.  
  181. /* setjmp only lets you jump in one direction
  182.    upwards in address
  183. */   
  184. #define SETJMP_ONE_DIRECTION
  185.  
  186.  
  187. /* End for cmpinclude */
  188.  
  189.  
  190.   /* if there is no input there return false */
  191. #define LISTEN_FOR_INPUT(fp) \
  192.   if((fp)->_cnt <=0 && (c=0,ioctl((fp)->_file, FIONREAD, &c),c<=0)) \
  193.      return 0
  194.  
  195.  /* have sys/ioctl.h */
  196. #define HAVE_IOCTL
  197. #define HAVE_SIGACTION
  198.   
  199. #define HAVE_XDR
  200.   
  201. #define SHARP_EQ_CONTEXT_SIZE 1024
  202. #undef VSSIZE
  203. #define VSSIZE 81520
  204. #undef MAXPAGE
  205. #define MAXPAGE (1<<15)
  206.  
  207. #define INSTALL_SEGMENTATION_CATCHER \
  208.         sigstack(&estack,0); \
  209.         (void) akcl_signal(SIGSEGV,segmentation_catcher);
  210.  
  211.   
  212.  
  213.   
  214.  
  215.  
  216.